
// npm i  @types/node  @types/express -D

const express = require("express");

const app = express();


app.get("/", (req, res) => {
    /*  res.write('fasong')
      res.end();*/
    // res.send(req.url)
    // res.send('这是get请求');
    res.status(201).json({ name: 'fasong', age: 20 });
});

app.post("/", (req, res) => {
    res.send('这是post请求');
});

app.put("/", (req, res) => {
    res.send('这是put请求');
});
app.delete("/", (req, res) => {
    res.send('这是delete请求');
});

app.listen(3008, () => {
    console.log("server is running at http://127.0.0.1:3008");
})